<template>
	<!-- 	<view>
		{{file}}
		<uni-file-picker v-model="file" limit="5" file-mediatype="all" file-extname="pdf,epub" @progress="progress"
			@success="success" @fail="fail" @select="select"></uni-file-picker>
	</view> -->
	<view id="read">123</view>
</template>
<!-- 
<script setup lang="ts">
	import Epub from 'epubjs'
	import { ref } from 'vue'
	const file = ref([])
	const flowIndex = ref(0)
	const rendition = ref(0)
	const book = ref({})


	// 获取上传状态
	function select(e) {
		console.log('选择文件：', e)
		console.log(new Epub(e.tempFilePaths[0]), 'Epub')
		book.value = new Epub("https://mp-9281e2b4-5558-4603-841a-433fcefa275b.cdn.bspapp.com/cloudstorage/108ca182-d460-4f65-be1b-5819d82d4dfd.epub");
		// book通过renderTo方法对电子书进行渲染，生成rendition对象
		rendition.value = book.value.renderTo("read", {
			// allowScriptedContent: true,
			// snap: true,
			// restore: false,
			width: 200,
			height: 500,
			// manager: "continuous",
			// spread: "none",
			// flow:
			// 	flowIndex.value === 0
			// 		? "scrolled-doc"
			// 		: flowIndex.value === 1
			// 			? "paginated"
			// 			: "", //scrolled-doc滚动 paginated分页
		})

		// 通过display方法进行渲染
		console.log(rendition.value, 'rendition.value')
		rendition.value.display()

	}
	// 获取上传进度
	function progress(e) {
		console.log('上传进度：', e)
	}

	// 上传成功
	function success(e) {
		console.log('上传成功')
	}

	// 上传失败
	function fail(e) {
		console.log('上传失败：', e)
	}
</script> -->

<style lang="scss" scoped>

</style>